<template>
<a-modal
      title="调剂审核界面"
      :visible="AuditHandleVisible"
      @ok="handleSave"
      @cancel="handleClose"
    >
      <a-form>
          <div>
          <a-form-item label="调剂状态">
              <a-select :allowClear="true" showSearch optionFilterProp="children" v-model="postParams.tjzt">
                <a-select-option v-for="i in selectMenu.tjztlb" :key="i.value" :value="i.value">{{ i.name }}</a-select-option>
              </a-select>
            </a-form-item>
            </div>
            <div>
            <a-form-item label="说明">
              <a-textarea placeholder="请输入..." v-model="postParams.shyj" :rows="4"/>
            </a-form-item>
            </div>
      </a-form>
    </a-modal>
</template>

<script>
// import moment from 'moment'

export default {
  props: {
    AuditHandleVisible: {
      default: false
    },
    info:{
      default:() =>({})
    }
  },
  data () {
    return {
      postParams: {
        tjzt: '',
        shyj: '',
        id:''
      },
      selectMenu:{
        tjztlb:[]
      },
	  checkType:''
    }
  },
  watch:{
    info(val){
      this.postParams.id = val.id
	  this.chekType = val.chekType
      console.log(this.postParams)
    }
  },
  created () {
    // 获取调剂状态
    this.$api.base.getChangeStatus().then( res => {
      this.selectMenu.tjztlb = res.data
      this.postParams.tjzt = res.data[1].value;
    })
  },
  methods: {
    handleSave () {
      if(this.chekType == 'single'){
        this.$api.recruitstat.reviewOfTransfersUpdate(this.postParams).then(res => {
          this.$emit('success', this.postParams)
        })

      }else{
        this.$api.recruitstat.reviewOfTransfersMulCheck(this.postParams).then(res => {
          this.$emit('success', this.postParams)
        })
      }
    },
    handleClose () {
      this.$emit('quit')
    }
  }
}
</script>
